<template>
  <view
    class="c-status-bar"
    :style="{ background: backgroundColor, opacity: scrollTop >= 100 ? 1 : scrollTop / 100 }"
  ></view>
</template>

<script>
export default {
  name: 'c-status-bar',
  props: {
    backgroundColor: {
      type: String,
      default: '#ffffff',
    },
    scrollTop: {
      type: Number,
      default: 0,
    },
  },
};
</script>

<style scoped>
.c-status-bar {
  position: fixed;
  left: 0;
  top: 0;
  width: 100vw;
  height: var(--status-bar-height);
  z-index: 998;
}
</style>
